<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;

class SettingsController extends Controller
{

	/**
	 * SettingController constructor.
	 */
	public function __construct()
	{
		$this->middleware('auth');
	}

	/**
	 * @return mixed
	 */
	public function index()
	{
		//dd(user()->settings);
		return view('users.setting');
	}

	/**
	 * @param Request $request
	 * @return mixed
	 */
	public function store(Request $request)
	{
		user()->settings()->merge($request->all());
		\Flash::success('修改成功');
		return back();
	}
}